home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sources.misc
- From: ron@mlfarm.UUCP (Ronald Florence)
- subject: v12i100: tek (patch 1)
- Sender: allbery@uunet.UU.NET (Brandon S. Allbery - comp.sources.misc)
-
- Posting-number: Volume 12, Issue 100
- Submitted-by: ron@mlfarm.UUCP (Ronald Florence)
- Archive-name: tek.p1
-
- This patch enables tek (yet another tektronics 4014 emulator) to be
- used as a filter for stdin when the output device is the console, and
- permits command-line specification of the CGI font for Tektronics
- emulation.
- --
-
- Ronald Florence {yale,uunet}!hsi!mlfarm!ron
-
-
- #! /bin/sh
- # This is a shell archive, meaning:
- # 1. Remove everything above the #! /bin/sh line.
- # 2. Save the resulting text in a file.
- # 3. Execute the file with /bin/sh (not csh) to create:
- # Readme.patch.1
- # tek.patch.1
- # This archive created: Mon May 14 12:09:38 1990
- # By: Ronald Florence (Maple Lawn Farm, Stonington, CT)
- export PATH; PATH=/bin:/usr/bin:$PATH
- echo shar: "extracting 'Readme.patch.1'" '(870 characters)'
- if test -f 'Readme.patch.1'
- then
- echo shar: "will not over-write existing file 'Readme.patch.1'"
- else
- sed 's/^X//' << \SHAR_EOF > 'Readme.patch.1'
- XTek (patch 1, 5.14.90)
- X
- XThis patch fixes one bug and adds one feature to tek (yet another
- Xtektronics 4014 emulator). CGI programs which take their input from
- Xstdin do not exit properly, and instead leave the console display in
- Xgraphics mode. To make tek and poly usable as a filters, the code now
- Xrestores the previous text mode on exiting if the input is from stdin.
- XWith this patch, it is now possible to do
- X
- X tek4014-program | tek [-wpaN]
- X <or>
- X graphics-in-ascii-points-program | poly [-spa]
- X
- Xand have the SCO multiscreen restored to text mode on the press of any
- Xkey.
- X
- XThe added feature is that the command line options now include -N,
- Xwhere N is a single digit from 1-9, used to specify the CGI graphics
- Xfont for tek. With a VGA display, and with VERIFYFONT off, fonts 3 or
- X4 work well for Tektronics emulation.
- X
- XRonald Florence
- X{yale,uunet}!hsi!mlfarm!ron
- SHAR_EOF
- if test 870 -ne "`wc -c < 'Readme.patch.1'`"
- then
- echo shar: "error transmitting 'Readme.patch.1'" '(should have been 870 characters)'
- fi
- fi
- echo shar: "extracting 'tek.patch.1'" '(4024 characters)'
- if test -f 'tek.patch.1'
- then
- echo shar: "will not over-write existing file 'tek.patch.1'"
- else
- sed 's/^X//' << \SHAR_EOF > 'tek.patch.1'
- X*** tek.c.orig Sun Mar 18 19:44:13 1990
- X--- tek.c Fri May 11 12:10:40 1990
- X***************
- X*** 1,6 ****
- X--- 1,7 ----
- X /*
- X * tek.c
- X * copyright 1988 Ronald Florence
- X+ * 5.12.90 fixed to restore mode when source is stdin
- X *
- X * as "tek" - Tek4014 picture files to CGI or WY99
- X * -w Accu-Weather maps
- X***************
- X*** 10,20 ****
- X * both:
- X * -p use plotter or printer (default display)
- X * -a preserve aspect ratio
- X! *
- X! * bugs: SIGINT doesn't work with wy99 modes. Possible solution is to
- X! * poll terminal on every iteration, with terminal set in raw mode.
- X */
- X
- X #include <signal.h>
- X #include <stdio.h>
- X #include <termio.h>
- X--- 11,20 ----
- X * both:
- X * -p use plotter or printer (default display)
- X * -a preserve aspect ratio
- X! * -N N is a single digit: use CGI font #N
- X */
- X
- X+ #include <sys/machdep.h>
- X #include <signal.h>
- X #include <stdio.h>
- X #include <termio.h>
- X***************
- X*** 22,27 ****
- X--- 22,28 ----
- X
- X #define int short /* for CGI functions */
- X #define CRT (wout[45] == 0)
- X+ #define CGI_FONTS wout[10]
- X #define To_tek "\033[?38h"
- X #define To_vt220 "\033[?38l"
- X #define Clr_tek "\033\f"
- X***************
- X*** 28,35 ****
- X #define Vt_reset "\033!p"
- X
- X int dev; /* device id */
- X! static int tty;
- X struct termio new, old;
- X static int tek; /* =1 if invoked as tek */
- X static char *progn;
- X static char *dspec[] = {"CGIDISP", "CGIPRNT", 0 };
- X--- 29,37 ----
- X #define Vt_reset "\033!p"
- X
- X int dev; /* device id */
- X! static int tty;
- X struct termio new, old;
- X+ static int mode; /* video mode to reset */
- X static int tek; /* =1 if invoked as tek */
- X static char *progn;
- X static char *dspec[] = {"CGIDISP", "CGIPRNT", 0 };
- X***************
- X*** 44,49 ****
- X--- 46,52 ----
- X h = 0,
- X aspect = 0, /* map to max CGI space */
- X opt = 0,
- X+ font = 0,
- X sig_handle(), quit_wyse();
- X char *device, *p, *getenv(), *strrchr();
- X
- X***************
- X*** 74,79 ****
- X--- 77,93 ----
- X case 'a' :
- X aspect = 3;
- X break;
- X+ case '1':
- X+ case '2':
- X+ case '3':
- X+ case '4':
- X+ case '5':
- X+ case '6':
- X+ case '7':
- X+ case '8':
- X+ case '9':
- X+ font = *p - '0';
- X+ break;
- X default :
- X usage();
- X }
- X***************
- X*** 89,94 ****
- X--- 103,111 ----
- X tty = open("/dev/tty", O_RDWR);
- X ioctl(tty, TCGETA, &new);
- X ioctl(tty, TCGETA, &old);
- X+ /* get the current video mode */
- X+ mode = ioctl(tty, CONS_GET, 0);
- X+
- X /* wyse 99 terminal? */
- X if (!h && !strncmp(getenv("TERM"), "wy99", 4))
- X {
- X***************
- X*** 134,139 ****
- X--- 151,159 ----
- X printf("%s: error %d opening %s\n", progn, -vq_error(), device);
- X exit (-1);
- X }
- X+ if (font > 0 && font <= CGI_FONTS)
- X+ vst_font(dev, font);
- X+
- X if (tek)
- X tekdecode(fi, opt);
- X else
- X***************
- X*** 141,152 ****
- X if (CRT)
- X getkey();
- X v_clswk(dev);
- X }
- X
- X
- X usage ()
- X {
- X! printf("usage: %s file\n", tek ? "tek [-wpa]" : "poly [-spa]");
- X exit (-1);
- X }
- X
- X--- 161,174 ----
- X if (CRT)
- X getkey();
- X v_clswk(dev);
- X+ if (CRT && fi == stdin)
- X+ ioctl(tty, (MODESWITCH | mode), 0);
- X }
- X
- X
- X usage ()
- X {
- X! printf("usage: %s [-N] file\n", tek ? "tek [-wpa]" : "poly [-spa]");
- X exit (-1);
- X }
- X
- X*** tek.man.orig Fri May 11 12:58:44 1990
- X--- tek.man Fri May 11 13:02:22 1990
- X***************
- X*** 8,13 ****
- X--- 8,15 ----
- X [
- X .I -wap
- X ] [
- X+ .I -N
- X+ ] [
- X .I file
- X ]
- X .br
- X***************
- X*** 15,20 ****
- X--- 17,24 ----
- X [
- X .I -sap
- X ] [
- X+ .I -N
- X+ ] [
- X .I file
- X ]
- X .SH DESCRIPTION
- X***************
- X*** 60,65 ****
- X--- 64,77 ----
- X be specified by declaring a (non-null)
- X .SM ASPECT
- X environment variable.
- X+ .PP
- X+ The
- X+ .I -N
- X+ option, where
- X+ .I N
- X+ is a digit from 1 to 9, is used to specify the CGI graphics font used by
- X+ .I tek.
- X+ The fonts are system and device dependent.
- X .SH BUGS
- X The available type sizes on CGI output devices may not match the
- X Tektronics display. The interactive Tektronics input functions are
- SHAR_EOF
- if test 4024 -ne "`wc -c < 'tek.patch.1'`"
- then
- echo shar: "error transmitting 'tek.patch.1'" '(should have been 4024 characters)'
- fi
- fi
- exit 0
- # End of shell archive
-
-